package com.jcooky.tutorfs.proxy.protocol;

import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;

import org.apache.mina.core.buffer.IoBuffer;

public class ReqRmdir extends AbstractMessage {
	private String dirname; // char length 256

	public void fromBytes(IoBuffer buf) {
		try {
			dirname = buf.getString(256, Charset.forName("UTF-8").newDecoder());
		} catch (CharacterCodingException e) {
			throw new RuntimeException(e);
		}
	}

	public void toBytes(IoBuffer buf) {
		throw new UnsupportedOperationException();
	}

	public int length() {
		return 256;
	}

	public String getDirname() {
		return dirname;
	}

	public void setDirname(String dirname) {
		this.dirname = dirname;
	}
	
}
